<!DOCTYPE HTML>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8">
    <title>Powerful JQuery Plugins</title>
    <link href="/js/jQueryUI/jquery-ui.css" type="text/css" rel="stylesheet"></link>
    <link href="/js/jQueryScrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet"></link>
  </head>
  
  <body>
    <a>初始值</a>
    <a>初始值</a>
    <a>初始值</a>
    <a>初始值</a>
    <script src="/js/jQuery/jquery-1.11.3.js" type="text/javascript"></script>
    <script src="/js/jQueryUI/jquery-ui.js" type="text/javascript"></script>
    <script src="/js/jQueryValidation/jquery.validate.js" type="text/javascript"></script>
    <script src="/js/jQueryValidation/messages_zh.js" type="text/javascript"></script>
    <script src="/js/jQueryValidation/additional-methods.js" type="text/javascript"></script>
    <script src="/js/jQueryValidation/additional-methods.js" type="text/javascript"></script>
    <script src="/js/jQueryScrollbar/perfect-scrollbar.jquery.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            var a = $("a:last");
            console.log(a.length);
            //jQuery对象并不是动态的
            //通过选择器选择的元素不会随着后来修改的元素的减少或者增加而变化
            //除非手动重新通过选择器取值
            $("a").click(function() {
                $("a").text("修改的");
                $("<a>添加</a>").prependTo($("body"));
                console.log(a.length);
            });
        });
    </script>
  </body>
</html>
